﻿#!/usr/bin/env python3

from pathlib import *



def main():
    '''
pathlib -  对文件路径的各种操作
    '''
    print(main.__doc__)
    print("="*30)

    s = Path('.')
    print([x for x in s.iterdir()])
    print(list(s.glob("*.py")))

    p = WindowsPath("C:/tmp/abc.py")
    p.with_name("hello.cpp")
    print(p)

    print(Path.cwd())
    print(Path.home())
    print(Path.cwd().stat())
    print(Path.cwd().is_dir())
    print(Path.cwd().is_file())






    




if __name__=='__main__':
    main()


